package com.mall.hadoop.job.tfirstgardenstatistics;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
/**
 * @全国园所首次登录统计
 * @author liugb
 * @Date 2016 7 13
 */
public class FirstGardenStatisticsMap extends Mapper<LongWritable, Text, Text, IntWritable>{

	@Override
	protected void map(LongWritable key, Text value, Context context)
			throws IOException, InterruptedException {
		// TODO Auto-generated method stub
		try {
			String str = value.toString();
			String[] split = str.split(",");
			String counttime = split[1];
			context.write(new Text(split[0]), new IntWritable(Integer.parseInt(counttime)));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();

		}
	}
	
}
